<?php

require_once '../include/common.inc.php';

if (!checkAdmin()) {
   header("LOCATION:index.php");
   exit;
}

$menu_index = 2;
$page_title = 'TABLA';
$guide_message = 'Customer | Promoter Commission | Edit';


getMyParam('cid');
$sql="select pc.*,co.deliver_status from promoter_commission pc , cus_order co where pc.order_id = co.id and pc.id=$cid";
$query = $db->query($sql);
$rs = $db->fetch_array($query);
if($rs["deliver_status"]==2)
	echo "<script>alert('This order is cancelled!');history.back(-1);</script>";
	
$rs['commission']=number_format($rs['commission'],2);

if($rs['status']==0)$rs['pay_date']=date('Y-m-d');
if($rs['status']==1)$rs['pay_date']=date('Y-m-d',$rs['pay_date']);

//Status
if($rs['status']==0) $status="<input type='radio' name='status' value='0' checked='checked' >No
                          <input type='radio' name='status' value='1' >Yes";
if($rs['status']==1) $status="<input type='radio' name='status' value='0'  >No
                          <input type='radio' name='status' value='1' checked='checked' >Yes";

include_once('menu_list.php');
require_once PrintEot('a_header');
require_once PrintEot('a_c_promoter_commission_edit');
require_once PrintEot('a_footer');

?>